/**
 * Плагин для показа блока загрузки
 * @author Vladimir Mozolev (mutantdd@yandex.ru)
 */
(function($){
    var options = {
        img:""
    };
    
    $.loadingBlock = function(id, command){
        command = command || "show";
        switch (command) {
            case "show":
                if ($("#" + id).length) {
                    $("#" + id).modal('show');
                } else {
                    //<c:url value='/resources/images/ajax-loader.gif'/>
                    $('body').append('<div id="' + id +'" class="modal hide fade" style="width:190px; margin: -95px 0 0 -95px;">\
                        <div class="modal-body">\
                            <img alt="loading..." src="' + options.img + '" />\
                        </div>\
                    </div>');
                    $("#" + id).modal('show');
                }
                break;
            case "hide":
                $("#" + id).modal('hide');
                break;
        }
        belka ="dfdf";
    };
    
    $.loadingBlock.options = function(inOptions) {
        $.extend(options, inOptions);
    };
})(jQuery);